Skip to content

feat(mutation): per-operation score breakdown and --min-score CI gate#76

Merged
yuchou87 merged 9 commits into
mainfrom
feat/mutation-v3
May 16, 2026
Merged

feat(mutation): per-operation score breakdown and --min-score CI gate#76
yuchou87 merged 9 commits into
mainfrom
feat/mutation-v3

Conversation

@yuchou87

Copy link
Copy Markdown
Contributor

Summary

  • Per-operation mutation score (operation_scores in JSON, ## Per-Operation Mutation Score table in Markdown and HTML): groups results by source.spec_path from index.json, aggregates killed/survivors per API operation, sorts weakest-first. Badges: ⚠ below 70%, ✓ at 100%; HTML rows color-coded (light red / light green).
  • --min-score CI gate: float64 flag (0.0–1.0, default 0 = disabled); exits 6 with a red violation list if any operation scores below the threshold. Validation rejects values outside [0, 1] before the run starts.
  • No breaking changes: Operation field in CaseMutationResult is additive; OperationScores in MutationRun uses omitempty.

New files

  • internal/mutation/score.goComputeOperationScores
  • internal/mutation/score_test.go — 4 unit tests (basic, empty, unknown fallback, tiebreak)

Modified files

  • internal/mutation/types.goOperationScore type, CaseMutationResult.Operation, MutationRun.OperationScores
  • internal/mutation/engine.go — reads source.spec_path, populates Operation, calls ComputeOperationScores
  • internal/mutation/render.gorenderOperationTable (Markdown), renderOperationTableHTML (HTML)
  • internal/mutation/render_test.go — 3 new render tests
  • cmd/mutate.go--min-score flag, validation, gate logic
  • scripts/acceptance.sh — AT-410–AT-416

Test Plan

  • go test ./... -count=1 — all packages pass
  • bash scripts/acceptance.sh — 272/272 passed
  • AT-410: mutate --help still shows --cases flag
  • AT-411: mutation-report.md contains Per-Operation after a run
  • AT-412: mutation-report.json contains operation_scores
  • AT-413: --min-score appears in mutate --help
  • AT-414: --min-score 1.5 returns error before running
  • AT-415: --min-score 0 (default) does not change exit behavior
  • AT-416: --min-score 0.99 exits 6 and prints violation list when an operation scores below threshold

@yuchou87 yuchou87 merged commit 7e7362c into main May 16, 2026
1 check passed
@yuchou87 yuchou87 deleted the feat/mutation-v3 branch May 16, 2026 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant